<script setup>
//vue 3写法 // 定义组件名称
// eslint-disable-next-line no-undef
defineOptions({
  name: 'homeIndex'
});
</script>

<template>
  <div class="home-container">
    <!-- 返回首页按钮 -->
    <BackToHomeButton />

    <!-- 主内容 -->
    <div class="content">
      <h1>欢迎来到首页</h1>

      <div class="link-container">
        <!-- 跳转到 JtSimulate 页面 -->
        <router-link to="/JtSimulate" class="link-button">JTT模拟器</router-link>

        <!-- 跳转到 GenCode 页面 -->
        <router-link to="/GenCode" class="link-button">生成激活码</router-link>
      </div>
    </div>
  </div>
</template>

<style scoped>

/* 页面内容 */
.content {
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 80%;
  max-width: 500px;
  margin: 20px 0;
}

/* 标题样式 */
h1 {
  font-size: 2.5rem;
  color: #42b983;
  margin-bottom: 30px;
  font-weight: bold;
}

/* 链接容器 */
.link-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: antiquewhite;
}

/* 跳转按钮样式 */
.link-button {
  display: inline-block;
  background-color: #42b983;
  color: white;
  padding: 15px 30px;
  font-size: 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.link-button:hover {
  background-color: #36a176;
}

.link-button:active {
  background-color: #2c8e63;
}

/* 使返回首页按钮固定 */
.back-to-home-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: #42b983;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.back-to-home-button:hover {
  background-color: #36a176;
}
/* 清除默认的 body margin */
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 确保首页容器从页面的顶部开始 */
.home-container {
  font-family: 'Arial', sans-serif;
  text-align: center;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

</style>
